<?php

declare (strict_types=1);
/**
 * @copyright 深圳市易果网络科技有限公司
 * @version 1.0.0
 * @link https://dayiguo.com
 */

namespace App\Request\User\Coupon;

use App\Request\RequestAbstract;

/**
 * 优惠券搜索验证器
 *
 * @author 刘兴永(aile8880@qq.com)
 * @package App\Request\User\Coupon
 */
class SearchRequest extends RequestAbstract
{
    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     */
    public function rules(): array
    {
        return [
           // 'keywords' => ['required', 'string'],
            'type' => ['required'],
            'max_price' => ['numeric'],
            'min_price' => ['numeric'],
            'longitude' => ['required_if:sort_type,4', 'numeric'],
            'latitude' => ['required_if:sort_type,4', 'numeric']
        ];
    }
}